package org.yellow.backend.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yellow.backend.mapper.prescriptionMapper;
import org.yellow.backend.pojo.prescription;

/**
 * @author: hy
 * @create: 2024-01-01
 */
@Service
public class prescriptionService {
    @Autowired
    prescriptionMapper mapper;

    /**
     * 根据id返回门诊处方
     * @param id
     * @return
     */
    public prescription selectPrescriptionById(int id){
        return mapper.selectById(id);
    }

    /**
     * 插入一个新的门诊处方至系统
     * @param pre
     * @return
     */
    public boolean insertNew(prescription pre){
        mapper.insert(pre);
        return true;
    }
}
